package com.wavehi.interceptor.web.controller;

import com.wavehi.interceptor.pojo.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

/**
 * @Author WaveHi
 * @Date 13/11/2021 下午 2:53
 * @Version 1.0
 * @Contact HJBWaveHi@163.com
 * @Description
 */
@Controller
public class MyController {

    @RequestMapping("/login")
    public String login(HttpSession session) {
        session.setAttribute("user", new User("Tom", "qwerty0"));
        return "redirect:/index";
    }

    @RequestMapping("/index")
    public String index() {
        return "index";
    }

    @RequestMapping("/toLogin")
    public String toLogin() {
        return "login";
    }
}
